﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Acms.DatabaseTest.Helpers
{
    public static class TemplateHelpers
    {
        public static void Template_Add(this TestConnection source, int id, int siteID, string name, string notes, int nodeType, bool excludeFromSearch, bool deleted)
        {
            string sql = @"
            
            set identity_insert acms.templates on 
    
            insert into acms.templates
                ([Id]
                ,[SiteId]
                ,[Name]
                ,[Notes]
                ,[NodeType]
                ,[ExcludeFromSearch]
                ,[Deleted])
            values
                (@0,@1,@2,@3,@4,@5,@6)

            set identity_insert acms.templates off 
            ";


            source.Execute(sql, new ParamCollection()
                .AddInputParam(System.Data.SqlDbType.Int, id)
                .AddInputParam(System.Data.SqlDbType.Int, siteID)
                .AddInputParam(System.Data.SqlDbType.VarChar, name)
                .AddInputParam(System.Data.SqlDbType.VarChar, notes)
                .AddInputParam(System.Data.SqlDbType.Int, nodeType)
                .AddInputParam(System.Data.SqlDbType.Bit, excludeFromSearch)
                .AddInputParam(System.Data.SqlDbType.Bit, deleted)
                
                );

        }
    }

}
